Image preview method and apparatus, electronic device, and storage medium

ABSTRACT

The present disclosure provides an image preview method and apparatus, an electronic device and a storage medium, where the method may include: determining a target object contained in a first image captured by the camera; cropping an image area containing the target object; and enlarging the image area to a predefined preview size, and previewing and displaying the enlarged image area in a shooting preview interface. Through the above method, a target object can be determined in a complex shooting scenario, and a user may observe the target object more clearly through a preview interface when an area where the target object is located is automatically enlarged and displayed, further avoiding the problem that it is difficult for the user to find the target object through movement of the head-mounted device due to an undersized field of view of an enlarged image area.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application claims priority to Chinese Application No. CN202110236249.2, filed on Mar. 3, 2021, which is hereby incorporated byreference in its entirety. □

TECHNICAL FIELD

The present disclosure relates to the field of electronic technologyand, in particular, to an image preview method and apparatus, anelectronic device, and a storage medium.

BACKGROUND

With the development of smart electronic devices, head-mounted deviceshave become a choice for more and more users. A head-mounted device atthe present stage is generally equipped with a shooting function. When auser is performing shooting, since the head-mounted device is worn onthe user's head, compared with mobile phones, cameras and other handhelddevices equipped with a shooting function, it is difficult to aim a lensat a target object to be shot due to movement of the lens resulting fromthe user's head rotation or other movement since the user can be easilyinfluenced by factors such as vision, hearing, smell, etc. If the targetobject is lost, the user needs to repeatedly search for the targetobject to be shot, thereby deteriorating user experience.

SUMMARY

In view of this, the present disclosure provides an image preview methodand apparatus, an electronic device, and a storage medium.

Specifically, the present disclosure is implemented through thefollowing technical solutions.

According to a first aspect of the present disclosure, provided is animage preview method applied to a head-mounted device provided with acamera, including:

determining a target object contained in a first image captured by thecamera;

cropping an image area containing the target object; and

enlarging the image area to a predefined preview size, and previewingand displaying the enlarged image area in a shooting preview interface.

According to a second aspect of the present application, provided is animage preview apparatus applied to a head-mounted device provided with acamera, including:

a determining unit, configured to determine a target object contained ina first image captured by the camera;

a cropping unit, configured to crop an image area containing the targetobject; and

a previewing unit, configured to enlarge the image area to a predefinedpreview size, and preview and display the enlarged image area in ashooting preview interface.

According to a third aspect of the present application, provided is anelectronic device, including:

a processor; and

a memory for storing instructions executable by the processor;

where the processor runs the executable instructions to implement themethod in the embodiment of the first aspect as described above.

According to a fourth aspect of the present application, provided is acomputer-readable storage medium, storing thereon computer instructionsexecutable by a processor to implement the method in the embodiment ofthe first aspect as described above.

It can be seen from the above technical solutions provided in thepresent disclosure, through determining a target object and thencropping the area where the target object is located to enlarge anddisplay the area containing the target object, the target object can bedetermined in a complex shooting scenario; and through enlarging anddisplaying the area where the target object is located, a user mayobserve the target object more clearly through a preview interface andthen perform shooting at a proper time; especially for a dynamic targetobject, a current state of the target object can be observed in thepreview interface in real time without moving the head along with themovement trajectory of the target object all the time, so that a mostsatisfactory image can be captured, thereby avoiding a situation wherethe target object is lost due to an improper head movement or asituation where a shooting opportunity is missed due to inability toaccurately observe a real-time state of the target object. Compared withmoving after manually enlarging the area where the target object islocated, the user's operation step is saved, further avoiding theproblem that it is difficult to find the target object due to anundersized field of view of the enlarged image area.

BRIEF DESCRIPTION OF DRAWINGS

The accompanying drawings herein, are incorporated into thespecification and constitute a part of the specification, illustrateembodiments that are consistent with the present disclosure and are usedto explain principles of the present disclosure together with thespecification.

FIG. 1 is a flowchart of an image preview method according to anexemplary embodiment of the present disclosure;

FIG. 2 is a schematic diagram of a head-mounted device applied in anembodiment of the present disclosure;

FIG. 3 is a specific flowchart of an image preview method according toan exemplary embodiment of the present disclosure;

FIG. 4 is a schematic diagram illustrating a first image preview methodaccording to an exemplary embodiment of the present disclosure;

FIG. 5 is a schematic diagram illustrating a second image preview methodaccording to an exemplary embodiment of the present disclosure;

FIG. 6 is a schematic diagram illustrating a third image preview methodaccording to an exemplary embodiment of the present disclosure;

FIG. 7 is a schematic diagram illustrating a fourth image preview methodaccording to an exemplary embodiment of the present disclosure;

FIG. 8 is a schematic diagram illustrating a fifth image preview methodaccording to an exemplary embodiment of the present disclosure;

FIG. 9 is a schematic diagram illustrating a sixth image preview methodaccording to an exemplary embodiment of the present disclosure;

FIG. 10 is a schematic diagram illustrating a seventh image previewmethod according to an exemplary embodiment of the present disclosure;

FIG. 11 is a schematic diagram illustrating an eighth image previewmethod according to an exemplary embodiment of the present disclosure;

FIG. 12 is a schematic diagram illustrating an electronic device forimage previewing according to an exemplary embodiment of the presentdisclosure; and

FIG. 13 is a block diagram illustrating an image preview apparatusaccording to an exemplary embodiment of the present disclosure.

DESCRIPTION OF EMBODIMENTS

Exemplary embodiments will be described in detail herein, examples ofwhich are illustrated in the accompanying drawings. When the followingdescription relates to the accompanying drawings, the same number indifferent drawings represents the same or similar elements unlessindicated otherwise. Implementations described in the followingexemplary embodiments do not represent all implementations that areconsistent with the present disclosure. Instead, they are merelyexamples of apparatuses and methods that are consistent with someaspects of the present disclosure as detailed in the appended claims.

The terms used in the present disclosure are merely for the purpose ofdescribing specific embodiments, but are not intended to limit thepresent application. A singular form such as “a”, “the” and “this” usedin the present disclosure and the appended claims is also intended toinclude a plural form unless other meanings are explicitly indicated inthe context. It will also be appreciated that the term “and/or” as usedherein refers to and includes any of or all of possible combinations ofone or more associated items listed.

It will be appreciated that although the terms such as “first”,“second”, “third” and the like may be used in the present disclosure todescribe various information, such information should not be limited tothese terms. These terms are only used to distinguish information of thesame type. For example, without departing from the scope of the presentdisclosure, first information may also be referred to as secondinformation; similarly, second information may also be referred to asfirst information. Depending on the context, the word “if” as usedherein can be interpreted as “once . . . ” or “when . . . ” or “inresponse to a determination”

The embodiments of the present disclosure will be described in detail inthe following.

FIG. 1 is a flow chart of an image preview method according to anexemplary embodiment of the present disclosure. The method is applied toa head-mounted device provided with at least one camera, and thehead-mounted device may be in the form of glasses, a helmet, a hat, etc.The head-mounted device is not limited in the present disclosure withregard to its specific form. With reference to FIG. 1, the above methodmay include the following steps.

Step 102, determining a target object contained in a first imagecaptured by the camera.

In an embodiment, a target object selected by a user may be determinedthrough a detected user-triggered operation. For example, thehead-mounted device may display a preview image captured by a currentlens to the user. When the user enables a shooting function but does notstart shooting, that is, when the user is in a shooting previewfunction, the interface displayed in front of the user may be termed asa shooting preview interface, a preview image captured by a currentcamera is displayed in the shooting preview interface, and the previewimage described above is termed as a first image. The user may directlyclick, in the preview image, a target object to be shot through a touchoperation; or, an area coverage selected by the user through a clickoperation or a drag operation is used as a target object; or, thehead-mounted device may perform eye-tracking on the user in order todetermine the user's focus point on the preview image, and when the gazestays for a preset time, the object where the gaze stays is determinedas a target object; or, the head-mounted device may determine a targetobject according to received dictation from the user, for example, theuser only needs to dictate “a pine tree”, and then the head-mounteddevice may determine the “a pine tree” in the preview image as a targetobject based on semantic analysis and image content analysis; or,according to an object characteristic preset in the head-mounted device,a target object that matches the object characteristic may also bedetermined. For example, the head-mounted device is preset with objectcharacteristics, such as human body characteristics, buildingcharacteristics, natural scene characteristics, etc., when thehead-mounted device is in the shooting preview function, if the lenscaptures a scene that matches a preset object characteristic, it may beautomatically determined as the target object. It should be understoodthat the method for determining the target object is only illustrativelydescribed here, the present disclosure is not limited thereto.

In an embodiment, the target object includes a dynamic object whoseposition is movable, a static object whose position is stationary,and/or a position area selected by the user in the preview interface. Itis worth noting that, when shooting previews, the head-mounted devicemay continuously acquire a current preview image. The frequency at whichthe preview images are acquired depends on the performance of thehead-mounted device, or may be customized according to engineeringempirical values. Once a preview image is acquired, a target objectcontained in the current preview image is determined. Through the abovemanner, real-time tracking of the target object can be achievedregardless of whether the user moves the camera or whether the targetobject is moving, such that the area where the target object is locatedis kept enlarged and displayed in the following steps.

In an embodiment, there may be one or more target objects, which is notlimited in the present disclosure. For example, the head-mounted deviceis preset with multiple object characteristics, multiple scenes thatmatch a preset object characteristic are captured by a lens under ashooting function, the multiple scenes may be automatically determinedas target objects, and the following steps are performed for the targetobjects respectively.

In the above-mentioned embodiments, the present disclosure providesmultiple ways to determine a target object, and the user can select amost suitable way to determine a target object so that needs ofdifferent users are met.

Step 104, cropping an image area containing the target object.

In an embodiment, an image area where the target object is located maybe cropped, so that the image area can be enlarged and displayed in asubsequent step. The size of the above image area can be adjustedaccording to the size of the target object. The image area needs tocontain the target object. However, when the target object selected bythe user is a part of the image area in the shooting preview interface,the image area selected by the user or a larger image area containingthe image area selected by the user may be directly cropped.

Step 106, enlarging the image area to a predefined preview size, andpreviewing and displaying the enlarged image area in a shooting previewinterface.

In an embodiment, the image area cropped in the above step may beenlarged to a predefined size and displayed in the shooting previewinterface for the user. The above-mentioned predefined size can beflexibly adjusted. For example, the cropped image area can be directlyenlarged to the maximum size of the preview interface of the user, thatis, the above-mentioned image area is displayed in full screen. In theabove-mentioned embodiment, the target object may be determined in realtime and the target object may be enlarged and displayed, which realizesautomatic real-time tracking as well as enlarging and displaying of thetarget object, thereby avoiding the problem that the difficulty intracking the target object is increased due to a narrowed field of viewresulting from that the user manually enlarges the target object fordisplay.

In an embodiment, the first image may be displayed while the image areais being displayed, and the target object may be marked in the firstimage. For example, a “picture in picture” style may be used to displaythe image area and the first image simultaneously, where the displayarea of the first image may be a preset fixed area or a changeable areathat can be moved, scaled, or closed according to user operations. Thesize of the first image may be flexibly adjusted or using a default sizedirectly. For example, the head-mounted device may display the firstimage and the image area simultaneously in a default state. When theimage area and the first image are displayed using the “picture inpicture” style, the image area may be used as a primary image fordisplay, and the first image is overlaid on the upper left corner of thepreview interface to form a “picture in picture”. When the image areadisplayed in the preview interface is partially blocked by the firstimage, the user, if in a desire to observe the blocked part, may dragthe display area of the first image to move the first image towards thelower right corner of the preview interface or another position fordisplay. In addition, the target object may be marked in the firstimage, for example, the position of the target object may be marked bymeans of a selecting frame, an arrow, or color alteration of the targetobject. For example, the head-mounted device displays the first imageand the image area simultaneously in a default state, where the imagearea is used as a primary image for display, and the first image isoverlaid on the upper left corner of the preview interface, and thetarget object may be marked in the first image on the upper left cornerto indicate the position of the target object in the image captured bythe current camera. Under a circumstance where the target object ismoving, it is convenient for the user to move the camera in timeaccording to the position of the target object, so that the camera cancontinuously capture the target object.

In an embodiment, a determination may be made with regard to whether thetarget object is about to move out of the first image according tomovement information of the target object. For example, under acircumstance where the target object is movable, when the target objectmoves in any direction and is about to exceed the viewfinder coveragecorresponding to the first image, a first prompt message may begenerated. The first prompt message may indicate the user to move thehead in any direction, so that the target object is maintained in theviewfinder coverage corresponding to the first image, and thus thehead-mounted device may the target object in the first image, andenlarge and display it. It is worth noting that the above-mentionedfirst prompt message may be a visualized message displayed in thepreview interface, such as an arrow or texts indicating a movementdirection, or may be a prompt message in the form of sound or vibration,or may be a combination of any of the above-mentioned prompting manners,and likewise the second prompt message described in the following steps.The prompt messages are not limited in the present disclosure withregard to their specific forms. In addition, when determining whetherthe target object is about to exceed the first image, the determinationmay be made based on whether the target object is close to the edge ofthe first image, or the determination may be made based on whether thearea of the target object within the first image is less than a presetpercentage of the total area of the target object, or the determinationmay be made in combination with information such as a speed or anacceleration at which the target object is moving. For example, when thearea of the target object within the first image is less than 80%, it isdetermined that the target object is about to exceed the viewfindercoverage corresponding to the first image.

In an embodiment, a second prompt message is generated under acircumstance where the target object moves out of the first image. Forexample, a determination with regard to whether the target object movesout of the first image may be made based on a percentage of the targetobject within the first image, for example, when the area of the targetobject within the first image is less than 50% of the total area of thetarget object, it can be determined that the target object has moved outof the viewfinder coverage of the first image. At this point, the secondprompt message may be generated to indicate the user to move thehead-mounted device in such a way that a first image re-captured by thehead-mounted device after moving contains the target object.

In an embodiment, device movement information recorded by a posturesensor carried in the head-mounted device may be acquired, where thedevice movement information is used to record a corresponding historicaldevice movement direction of the head-mounted device when the targetobject moves out of the first image; and a second prompt messagecontaining a first movement direction is generated, where the firstmovement direction is an opposite direction of the historical devicemovement direction. Where the posture sensor may include motion sensorssuch as a three-axis gyroscope, a three-axis accelerometer, a three-axiselectronic compass, etc., which record information such as a movementangle, a movement direction, a movement distance of the head-mounteddevice or the like. In an actual shooting operation where the user wearsthe head-mounted device to perform shooting, the target object may bemoved out of the shooting range of the lens every now and then due tovarious factors such as shooting jitters or an overlength movingdistance. At this point, the historical movement direction of thehead-mounted device when the target object moves out of the viewfindercoverage of the first image can be determined, and the user is promptedto move the head-mounted device in an opposite direction, that is, tomove the head-mounted device back to a position where the target objectcan be captured, so that the user moves the head-mounted device tore-acquire the first image containing the target object.

In an embodiment, object movement information of the target object maybe acquired, where the object movement information is used to record acorresponding historical object movement direction of the target objectwhen it moves out of the first image; and a second prompt messagecontaining a second movement direction is generated, where the secondmovement direction is a same direction as the historical object movementdirection. When the target object is a person or thing that is movable,the movement direction of the target object when the target object movesout of the viewfinder coverage of the first image may be determinedaccording to the movement trajectory of the target object, and the useris prompted to move the head-mounted device towards a same direction ofthe movement direction of the target object, that is, to move thehead-mounted device to follow the movement trajectory of the targetobject, so that the camera can re-capture the first image containing thetarget object.

In an embodiment, a second image containing the target object may beacquired under a circumstance where the target object moves out of thefirst image, where the second image has a wider field of view than thatof the first image; and a second prompt message is generated accordingto the second image

In an embodiment, acquiring the second image containing the targetobject captured by the head-mounted device may include: acquiring thesecond image shot with a relatively wider field of view at a historicalmoment by a zoom camera currently used by the head-mounted device; wherethe first image is an image captured by the zoom camera with arelatively narrower field of view, and an interval period between thehistorical moment and the current moment is shorter than a preset periodthreshold, or a moving distance or a rotation angle generated by thetarget object and/or the head-mounted device between the historicalmoment and the current moment is less than a preset threshold to ensurethat the acquired second image is of sufficient reference. Thehead-mounted device, on determining that the target object has moved outof the first image, may generate a prompt message according to thesecond image to remind the user to move the head-mounted deviceaccording to the prompt message, so that the first image captured afterthe user moves the head-mounted device contains the target object.

In an embodiment, when the head-mounted device is equipped with multiplecameras, assuming that each of the cameras has a different field ofview, the wider the field of view is, the wider the viewfinder coverageis, and the narrower the field of view is, the narrower the viewfindercoverage is; if an image captured by a current camera is termed as afirst image, when the target object moves out of the viewfinder coverageof the current camera, a second image, which contains the target objectand is captured by another camera, may be used, and the above-mentionedanother camera has a wider field of view than the field of view used bythe camera collecting the first image. At this point, the user may beindicated to move the head-mounted device according to the position ofthe target object in the acquired second image, so that the first imagere-captured by the current camera contains the target object, moreover,the above-mentioned second image may be captured by the further cameraat a historical moment, or captured by the further camera at a currentmoment. If a second image captured at a historical moment is used, aninterval period between the historical moment and the current moment isshorter than a preset period threshold, or a moving distance or arotation angle of the target object and/or the head-mounted devicebetween the historical moment and the current moment is less than apreset threshold to ensure that the acquired second image is ofsufficient reference.

It is worth noting that the second image captured by the head-mounteddevice may be a single-frame picture, a video, or a real-time previewimage output by a camera. For example, a single-frame picture shot witha relatively wider field of view at a historical moment by a zoom cameracarried in the head-mounted device is used as the second image, and areal-time preview image captured with a relatively narrower field ofview at a current moment is used as the first image; or, thehead-mounted device carries a first camera having a relatively narrowerfield of view and a second camera having a relatively wider field ofview, where the first camera and the second camera capture imagessimultaneously, a preview image captured by the first camera is used asthe first image, and a video image captured by the second camera at ahistorical moment is used as the second image. Also, it will beappreciated that “acquiring a second image” in the above embodiment doesnot mean “shooting a second image”, instead, the shooting action may becompleted earlier, or may be performed after it is determined that thefirst image does not contain the target object. The present disclosuredoes not limit the time point at which the second image is captured.

In an embodiment, the second image may also be an image captured by acamera equipped on a further head-mounted device. For example, differenthead-mounted devices may use short-range wireless communicationtechnologies to communicate data. When the target object moves out ofthe first image captured by any head-mounted device used by the user, afurther head-mounted device that can communicate with this head-mounteddevice may be searched in real time and a connection therewith isestablished, or a successfully established connection is directly usedto acquire a second image captured by the further head-mounted device,if the second image captured by the further head-mounted device containsthe target object, the position of the target object may be determinedaccording to the above-mentioned second image, and then second promptmessage is generated to indicate the user to move the head-mounteddevice to re-acquire the first image containing the target object; or,an association relationship between head-mounted devices ispre-established, when the target object moves out of a first imagecaptured by any head-mounted device used by the user, priority is givento an associated device with which the association relationship hasalready been established to acquire a second image containing the targetobject, if the acquiring fails, to acquire the second image from afurther head-mounted device with which the association relationship hasnot yet been established, the present disclosure does not specificallylimit how to communicate data between the head-mounted devices.

It is worth noting that the first image and the enlarged image area maybe displayed in the preview interface simultaneously, moreover, theabove-mentioned first prompt message and second prompt message may bedisplayed either in the image area or in the first image. Since theenlarged image area has a narrower field of view, displaying a promptmessage in the first image will achieve an effect that the user isprompted more accurately to move the head-mounted device.

It can be seen from the above technical solutions provided in thepresent disclosure, through determining a target object and thencropping the area where the target object is located to enlarge anddisplay the area containing the target object, the target object can bedetermined in a complex shooting scenario; and through enlarging anddisplaying the area where the target object is located, a user mayobserve the target object more clearly through a preview interface andthen perform shooting at a proper time; especially for a dynamic targetobject, a current state of the target object can be observed in thepreview interface in real time without moving the head along with themovement trajectory of the target object all the time, so that a mostsatisfactory image can be captured, thereby avoiding a situation wherethe target object is lost due to an improper head movement or asituation where a shooting opportunity is missed due to inability toaccurately observe a real-time state of the target object. Compared withmoving after manually enlarging the area where the target object islocated, the user's operation step is saved, also avoiding the problemthat it is difficult to find the target object due to an undersizedfield of view of the enlarged image area. Additionally, when the targetobject moves out of or is about to move out of the first image, it isdetermined based on movement information of the target object ormovement information of the head-mounted device according to the presentdisclosure, how to move the head-mounted device at the current momentfor the purpose to re-capture the target object, and the prompt messagegenerated finally can accurately indicate the user to move thehead-mounted device, thereby further avoiding the problem that it isdifficult for the user to capture the target object due to inability toaccurately determine a movement direction.

A head-mounted device in a type of smart glasses as shown in FIG. 2 isequipped with two cameras, which are respectively a camera 21 and acamera 22. The above-mentioned cameras may be arranged in the middle ofthe head-mounted device as shown in the figure, or arranged on bothsides of the head-mounted device, or at any position of the head-mounteddevice. different cameras may be intensively arranged in one place ordispersedly arranged in different positions of the head-mounted device,and the head-mounted device is not specially limited in the presentdisclosure with regard to installation positions and number of camerasthereon; its frame has a touch area 23 arranged thereon, with touch andslide operations in the touch area 23, the user can trigger, close, andadjust various functions or parameters set on the head-mounted device,for example, a target object or an area where the target object islocated may be selected through a click or drag operation in the toucharea, and an image captured using the head-mounted device camera isdenoted with 24.

FIG. 3 is a flowchart of an image preview method according to anexemplary embodiment of the present disclosure. The above-mentionedmethod may include the following steps. The steps will be described indetail hereunder with reference to FIG. 2 and FIG. 3.

Step 302, determining a target object in a first image.

As shown in FIG. 2, assuming that the head-mounted device currently usesa camera 21 for shooting preview, the first image shown as 24 iscaptured as a preview image under the viewfinder coverage correspondingto the current field of view of the camera 21; in order to be moreintuitive, an image 40 in FIG. 4 is used to represent a current imagecaptured by the camera 21. As shown in 40, it contains an object 41“bird”, an object 42 “tree”, an object 43 “sun” and objects 44“mountains”. Assuming that the user desires to use 41 as a targetobject, at this point, the user may click 41 through a touch operationin the touch area 23, or perform a frame selection on 41 through a dragoperation, so that the head-mounted device determines 41 to be thetarget object; or the user may set a “bird” label, when the head-mounteddevice identifies the object 41 in the first image, it may directlydetermine 41 to be the target object; or, the user may dictate “birds”,and the head-mounted device, on collecting voice information of theuser, matches the content dictated by the user with objects in the firstimage and subsequently determines 41 that matches the “birds” as thetarget object.

Step 304, cropping an image area containing the target object. In thisstep, an image area containing the target object in the first image maybe cropped. The size of the image area may be a default value or may beflexibly adjusted according to the user's drag; as shown in FIG. 4,assuming that the target object determined by the user is 41 and thetarget object 41 is contained in the dashed box 45, at this point, theimage area in the dashed box 45 can be cropped, and Step 306 issubsequently executed.

Step 306, enlarging the image area, and previewing and displaying thesame. In this step, as shown in image 46 on the right side of FIG. 4,the image area 45 cropped in Step 306 may be enlarged. For example, theimage area 45 may be enlarged to a size of a shooting preview interfaceof the head-mounted device to obtain an image 46, and the image 46 isdisplayed in the shooting preview interface of the head-mounted device,so that the user can observe the target object 41 more clearly throughthe image 46. It is worth noting that the first image 40 may bedisplayed in the image 46, and the target object may be marked in thefirst image 40. The display area of the first image 40 may be a presetfixed area or a changeable area that can be moved, scaled, or closedaccording to user operations. The size of the first image 40 may beflexibly adjusted or using a default size directly. As shown in FIG. 5,the head-mounted device may display the first image and the enlargedimage area simultaneously in a default state, and the enlarged imagearea may be used as a primary image for display, and the first image isoverlaid on the upper left corner of the preview interface to form a“picture in picture” display style. When the enlarged image area ispartially blocked by the first image, the user, if in a desire toobserve the blocked part, may drag the display area of the first imageto move the first image towards the lower right corner of the previewinterface or another position for display. In addition, the targetobject may be marked in the first image, as shown in a dashed box 51 ofFIG. 5, the position of the target object may be marked in any mannersuch as a selecting frame or the like to indicate the position of thetarget object in the first image captured by the camera 21. Under acircumstance where the target object is moving, it is convenient for theuser to move the camera in time according to the position of the targetobject, so that the camera can continuously capture the target object.

Step 308, determining whether the target object has moved out of thefirst image.

If the target object has moved out of the first image, as shown in FIG.6, assuming that the target object 41 moved out of the first image forthe reason that the target object 41 itself moved in the direction ofthe dashed arrow as shown in the figure and finally moved out of thefirst image, Step 310 a 1 may be executed to acquire movementinformation of the target object 41. The above-mentioned movementinformation is used to record the historical movement direction of thetarget object 41 when it moves out of the first image, that is, thedirection indicated by the dashed arrow in FIG. 6; then Step 312 a isexecuted to generate a second prompt message containing a secondmovement direction, where the second movement direction may be a samedirection as the direction indicated by the dashed arrow in FIG. 6;moreover, the prompt message can be displayed on the enlarged imagearea, as shown in FIG. 7, the arrow may be used to prompt the user tomove the head-mounted device in the direction of arrow, or a textreminder message may be displayed on the interface, e.g., “Please movein the direction of the arrow”, to further remind the user of thedirection in which to move the head-mounted device, meanwhile the promptmessage may be displayed in the first image that is displayedsimultaneously with the enlarged image area in order to further help theuser better control the angle or the direction in which to move thehead-mounted device.

If the target object has moved out of the first image, as shown in FIG.8, assuming that the target object 41 moved out of the first image forthe reason that the user wearing the head-mounted device moved thedevice so that the first image captured by the camera 21 moved leftwardalong the direction of arrow shown in FIG. 8 and eventually the firstimage captured by the camera 21 does not contain the target object,where the dotted line in FIG. 8 is the first image captured by thecamera 21 prior to movement of the head-mounted device and the solidline in FIG. 8 is the first image captured by the camera 21 subsequentto movement of the head-mounted device. Step 310 a 1 may be executed toacquire movement information of the head-mounted device. Theabove-mentioned movement information is used to record the historicalmovement direction of the head-mounted device, that is, the directionindicated by the arrow in FIG. 8; then Step 312 a is executed togenerate a second prompt message containing a first movement direction,where the first movement direction may be an opposite direction of thedirection indicated by the arrow in FIG. 8; moreover, the prompt messagemay be displayed on the enlarged image area, as shown in FIG. 9, thearrow shown may be used to prompt the user to move the head-mounteddevice in the direction of arrow, or a text reminder message may bedisplayed on the interface, e.g., “Please move in the direction ofarrow”, to further remind the user of the direction in which to move thehead-mounted device, meanwhile the prompt message may be displayed inthe first image that is displayed simultaneously with the enlarged imagearea in order to further help the user better control the angle or thedirection in which to move the head-mounted device.

It is worth noting that in an actual application process, there may be acase where the target object and the head-mounted device movesimultaneously. In the above case, the movement direction of the targetobject and the movement direction of the device may be determinedrespectively, and then the two determined directions are performed witha comprehensive calculation to derive a finally determined directionaccording to which the user is reminded to move the head-mounted device.

In addition, if the target object has moved out of the first image, Step310 a 2 may be executed. If a field of view used by the camera 22 isgreater than that of the camera 21, the viewfinder coverage of thecamera 22 will be wider than that of the camera 21, thus the camera 22may capture a second image containing the target object. At this point,the second image captured by the camera 22 may be used. When the secondimage contains the target object, a second prompt message may begenerated according to the second image to remind the user to moveaccording to the second prompt message, where the second image may be animage captured by the camera 22 at a current moment or an image capturedat a historical moment. If it is captured at a historical moment, aninterval period between the historical moment and the current moment isnot longer than a preset threshold, or a moving distance or a rotationangle of the target object or the head-mounted device between thehistorical moment and the current moment is less than a preset thresholdto ensure that the second image is of a sufficient reference value.

If the target object has not moved out of the first image yet, Step 310b is executed at this point to determine whether the target object isabout to move out of the first image. As shown in FIG. 10, assuming thatthe target object has moved to the edge of the first image in adirection indicated by the dotted line, in combination with informationsuch as a moving direction or a speed of the target object, if it isdetermined at this point that the target object is about to move out ofthe first image, then Step 312 b is executed to determine movementinformation of the target object. Further, a first prompt message isgenerated and displayed according to the movement information, i.e.,Steps 314 b˜316 b. For example, as shown in FIG. 11, arrows are used inboth the first image and the enlarged image area to indicate the user tomove the head-mounted device.

It is worth noting that the present disclosure does not limit thesequence of different steps. For example, Steps 310 a 1 and 310 a 2 maybe performed simultaneously or in a preset sequence. The steps in theabove embodiments are only an example of processing logic correspondingto the image preview method provided in the present disclosure. Anymodification that does not depart from the spirit and principle of thepresent disclosure should fall into the protection scope of the presentdisclosure.

Corresponding to the foregoing method embodiments, this specificationalso provides embodiments of a device.

FIG. 12 is a schematic diagram illustrating an electronic device forimage previewing according to an exemplary embodiment of the presentdisclosure. With reference to FIG. 12, at the hardware level, theelectronic device includes a processor 1202, an internal bus 1204, anetwork interface 1206, a memory 1208, and a non-volatile memory 1210.As a matter of course, hardware required for other services may also beincluded. The processor 1202 reads a corresponding computer program fromthe non-volatile memory 1210 and then runs the same in the memory 1208to form an image preview apparatus at a logical level. As a matter ofcourse, in addition to software implementations, the present disclosuredoes not exclude other implementations, such as logic devices or acombination of software and hardware, etc. That is to say, the executionbody of the following processing flow is not limited to logic units, butmay also be hardware or logic devices.

FIG. 13 is a block diagram illustrating an image preview apparatusaccording to an exemplary embodiment of the present disclosure. Withreference to FIG. 13, the apparatus is applied to a head-mounted deviceprovided with a camera. The apparatus includes a determining unit 1302,a cropping unit 1304 and a previewing unit 1306, among them:

the determining unit 1302 is configured to determine a target objectcontained in a first image captured by the camera;

the cropping unit 1304 is configured to crop an image area containingthe target object; and

the previewing unit 1306 is configured to enlarge the image area to apredefined preview size, and preview and display the enlarged image areain a shooting preview interface.

In an embodiment, previewing and displaying the image area in theshooting preview interface of the camera includes: displaying the firstimage while the image area is being displayed, and marking the targetobject in the first image.

In an embodiment, the apparatus further includes a first prompt unit1308, which is configured to: determine whether the target object isabout to move out of the first image according to movement informationof the target object; and

generate a first prompt message under a circumstance where that thetarget object is about to move out of the first image, where the firstprompt message is used to indicate such a movement of the head-mounteddevice that the target object is maintained in the first image.

In an embodiment, the apparatus further includes a second prompt unit1310, which is configured to: generate a second prompt message under acircumstance where the target object moves out of the first image, wherethe second prompt message is used to indicate such a movement of thehead-mounted device that a first image re-captured by the head-mounteddevice after the movement contains the target object.

In an embodiment, the generating the second prompt message includes:

acquiring device movement information recorded by a posture sensorcarried in the head-mounted device, where the device movementinformation is used to record a corresponding historical device movementdirection of the head-mounted device when the target object moves out ofthe first image; and

generating the second prompt message containing a first movementdirection, where the first movement direction is an opposite directionof the historical device movement direction.

In an embodiment, the generating the second prompt message includes:

acquiring object movement information of the target object, where theobject movement information is used to record a corresponding historicalobject movement direction of the target object when it moves out of thefirst image; and

generating the second prompt message containing a second movementdirection, where the second movement direction is a same direction asthe historical object movement direction.

In an embodiment, the generating the second prompt message includes:

acquiring a second image containing the target object under acircumstance where the target object moves out of the first image, wherethe second image has a wider field of view than that of the first image;and

generating a second prompt message according to the second image.

For the implementation process of the functions and roles of each unitin the above-mentioned apparatus, reference may be made to theimplementation process of the corresponding steps in the above-mentionedmethod for details, which will not be described here again.

For the apparatus embodiments, since they basically correspond to themethod embodiments, reference may be made to description part of themethod embodiments for relevant portions. The apparatus embodimentsdescribed above are only illustrative. The units described as separateparts may or may not be physically separate, and the componentspresented as units may or may not be physical units, that is, may belocated in one position, or may be distributed on multiple networkunits. A part or all of the modules may be selected according to actualneeds to achieve the purpose of the solutions of the present disclosure,and those of ordinary skill in the art can understand and implement themwithout any creative effort.

In an exemplary embodiment, further provided is a non-transitorycomputer-readable storage medium including an instruction, such as amemory including an instruction which is executed by a processor of theimage preview apparatus to implement the method described in any one ofthe foregoing embodiments. For example, the method may include:

determining a target object contained in a first image captured by thecamera; cropping an image area containing the target object; andenlarging the image area to a predefined preview size, and previewingand displaying the enlarged image area in a shooting preview interface.

The non-transitory computer-readable storage medium may be an ROM, arandom access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, anoptical data storage device, etc., which is not limited in the presentdisclosure.

The above descriptions are only preferred embodiments of the presentdisclosure, but are not intended to limit the present disclosure. Anymodifications, equivalent replacements, improvements, etc., made withinthe spirit and principle of the present disclosure, should be includedin the protection scope of the present disclosure.

What is claimed is:
 1. An image preview method applied to a head-mounteddevice provided with a camera, comprising: determining a target objectcontained in a first image captured by the camera; cropping an imagearea containing the target object; and enlarging the image area to apredefined preview size, and previewing and displaying the enlargedimage area in a shooting preview interface.
 2. The method according toclaim 1, wherein previewing and displaying the image area in theshooting preview interface of the camera comprises: displaying the firstimage while the image area is being displayed, and marking the targetobject in the first image.
 3. The method according to claim 1, furthercomprising: determining whether the target object is about to move outof the first image according to movement information of the targetobject; and generating a first prompt message under a circumstance wherethe target object is about to move out of the first image, wherein thefirst prompt message is used to indicate such a movement of thehead-mounted device that the target object is maintained in the firstimage.
 4. The method according to claim 1, further comprising:generating a second prompt message under a circumstance where the targetobject moves out of the first image, wherein the second prompt messageis used to indicate such a movement of the head-mounted device that afirst image re-captured by the head-mounted device after the movementcontains the target object.
 5. The method according to claim 4, whereinthe generating the second prompt message comprises: acquiring devicemovement information recorded by a posture sensor carried in thehead-mounted device, wherein the device movement information is used torecord a corresponding historical device movement direction of thehead-mounted device when the target object moves out of the first image;and generating the second prompt message containing a first movementdirection, wherein the first movement direction is an opposite directionof the historical device movement direction.
 6. The method according toclaim 4, wherein the generating the second prompt message comprises:acquiring object movement information of the target object, wherein theobject movement information is used to record a corresponding historicalobject movement direction of the target object when it moves out of thefirst image; and generating the second prompt message containing asecond movement direction, wherein the second movement direction is asame direction as the historical object movement direction.
 7. Themethod according to claim 4, wherein, the method further comprises:acquiring a second image containing the target object under acircumstance where the target object moves out of the first image,wherein the second image has a wider field of view than that of thefirst image; the generating the second prompt message comprises:generating the second prompt message according to the second image. 8.An electronic device, comprising: a processor; and a memory for storinginstructions executable by the processor; wherein the processor runs theexecutable instructions to: determine a target object contained in afirst image captured by the camera; crop an image area containing thetarget object; and enlarge the image area to a predefined preview size,and preview and display the enlarged image area in a shooting previewinterface.
 9. The electronic device according to claim 8, wherein theprocessor runs the executable instructions to: display the first imagewhile the image area is being displayed, and mark the target object inthe first image.
 10. The electronic device according to claim 8, whereinthe processor runs the executable instructions to: determine whether thetarget object is about to move out of the first image according tomovement information of the target object; and generate a first promptmessage under a circumstance where the target object is about to moveout of the first image, wherein the first prompt message is used toindicate such a movement of the head-mounted device that the targetobject is maintained in the first image.
 11. The electronic deviceaccording to claim 8, wherein the processor runs the executableinstructions to: generate a second prompt message under a circumstancewhere the target object moves out of the first image, wherein the secondprompt message is used to indicate such a movement of the head-mounteddevice that a first image re-captured by the head-mounted device afterthe movement contains the target object.
 12. The electronic deviceaccording to claim 11, wherein the processor runs the executableinstructions to: acquire device movement information recorded by aposture sensor carried in the head-mounted device, wherein the devicemovement information is used to record a corresponding historical devicemovement direction of the head-mounted device when the target objectmoves out of the first image; and generate the second prompt messagecontaining a first movement direction, wherein the first movementdirection is an opposite direction of the historical device movementdirection.
 13. The electronic device according to claim 11, wherein theprocessor runs the executable instructions to: acquire object movementinformation of the target object, wherein the object movementinformation is used to record a corresponding historical object movementdirection of the target object when it moves out of the first image; andgenerate the second prompt message containing a second movementdirection, wherein the second movement direction is a same direction asthe historical object movement direction.
 14. The electronic deviceaccording to claim 11, wherein the processor runs the executableinstructions to: acquire a second image containing the target objectunder a circumstance where the target object moves out of the firstimage, wherein the second image has a wider field of view than that ofthe first image; generate the second prompt message according to thesecond image.
 15. A computer-readable storage medium, storing thereoncomputer instructions executable by a processor to implement the methodaccording to claim 1.